import request from '@/config/axios'

// ERP 库房规则 VO
export interface WarehouseRuleVO {
  id: number // id
  ruleType: string // 规则类型
  rule: string // 规则
}

// ERP 库房规则 API
export const WarehouseRuleApi = {
  // 查询ERP 库房规则分页
  getWarehouseRulePage: async (params: any) => {
    return await request.get({ url: `/erp/warehouse-rule/page`, params })
  },

  // 查询ERP 库房规则详情
  getWarehouseRule: async (id: number) => {
    return await request.get({ url: `/erp/warehouse-rule/get?id=` + id })
  },

  // 新增ERP 库房规则
  createWarehouseRule: async (data: WarehouseRuleVO) => {
    return await request.post({ url: `/erp/warehouse-rule/create`, data })
  },

  // 修改ERP 库房规则
  updateWarehouseRule: async (data: WarehouseRuleVO) => {
    return await request.put({ url: `/erp/warehouse-rule/update`, data })
  },

  // 删除ERP 库房规则
  deleteWarehouseRule: async (id: number) => {
    return await request.delete({ url: `/erp/warehouse-rule/delete?id=` + id })
  },

  // 导出ERP 库房规则 Excel
  exportWarehouseRule: async (params) => {
    return await request.download({ url: `/erp/warehouse-rule/export-excel`, params })
  },
}